package com.mogujie.tt.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

import com.mogujie.tt.R;
import com.mogujie.tt.app.IMApplication;
import com.mogujie.tt.ui.base.QZBaseActivity;

/**
 * Created by user on 2015/11/5.
 */
public class CombinationLockActivity extends QZBaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LayoutInflater.from(this).inflate(R.layout.tt_activity_combinationlock, topContentView);
        showTopInformation("密码锁");

        findViewById(R.id.rl_switch_notification).setOnClickListener(new View.OnClickListener() {//图案解锁
            @Override
            public void onClick(View v) {
                if(!IMApplication.getInstance().getLockPatternUtils().savedPatternExists()){
                    startActivity(new Intent(CombinationLockActivity.this, GuideGesturePasswordActivity.class));
                }else{
                    startActivity(new Intent(CombinationLockActivity.this, GesturesActivity.class));
                }
            }
        });

        findViewById(R.id.rl_switch_sound).setOnClickListener(new View.OnClickListener() {//数字解锁
            @Override
            public void onClick(View v) {

            }
        });
    }

    /**
     * 显示顶部信息
     */
    private void showTopInformation(String test){
        if(test == null){
            return;
        }
        setTopBarDisplay();

        setCenterText(test);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        onDest();
    }

    public void onClickExit(View view){
        finish();
    }
}
